# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Kyle Keen <keenerd@gmail.com>

pkgname=jupyter-notebook
_pipname=notebook
pkgver=6.5.4
pkgrel=3
pkgdesc='The language-agnostic HTML notebook application for Project Jupyter'
arch=(any)
url='https://github.com/jupyter/notebook'
license=(BSD)
depends=(python-jinja python-tornado python-terminado python-traitlets jupyter-nbformat python-jupyter-core
         python-jupyter-client python-send2trash jupyter-nbconvert python-prometheus_client
         python-argon2_cffi python-ipython-genutils jupyter-nbclassic)
# Much of their official dependency tree appears inverted and circular?
makedepends=(python-build python-installer python-wheel python-jupyter-packaging python-setuptools)
checkdepends=(python-pytest python-requests)
optdepends=('pandoc: notebook export' 'jupyter-widgetsnbextension: interactive widgets')
source=(https://pypi.io/packages/source/${_pipname:0:1}/$_pipname/$_pipname-$pkgver.tar.gz)
sha256sums=('517209568bd47261e2def27a140e97d49070602eea0d226a696f42a7f16c9a4e')

build() {
  cd notebook-$pkgver
  python -m build --wheel --no-isolation --skip-dependency-check
}

#check() {
#  cd notebook-$pkgver
#  pytest -v
#}

package() {
  cd notebook-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl

  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
  install -Dm644 jupyter-notebook.desktop -t "$pkgdir"/usr/share/applications
}
